<?php 
/* import database connection variables */
require_once __DIR__ . '/db_config.php';

if(!$db){ 
echo "DB!";    exit();} 
$datas = array();
$get = mysql_query("select * from produk ");
$show = array();while($k=mysql_fetch_array($get)){
$show[] = array(
	"id_produk"=>$k["id_produk"],
	"nama_produk"=>$k["nama_produk"],
	"link_image"=>"http://hanjuang.web.id/foto/foto_produk/".$k["foto"],	
	"komposisi"=>$k["komposisi"],
	"harga"=>$k["harga"]);
}
$datas2 = array("daftar_produk" => $show, "success"=>1);
$json_format = json_encode($datas2);
echo $json_format;
?>